(function(window, undefined) {
	var dino = window.dino = window.dino || {};

	var skill = function(opts) {
			this.name = opts.name;
			// CD
			this.coolDownInterval = opts.coolDownInterval;
			// 剩余CD
			this.lastCDI = 0;
			this.behavior = opts.behavior;
			// 是否可以施放技能
			this._ready = false;
		};
	// 重置技能
	skill.prototype.resetCD = function() {
		this.lastCDI = 0;
	};

	// 施放技能
	skill.prototype.fire = function(opts) {
		if(this.lastCDI == 0) {
			// 施放技能
			this.trigger('beforeFire', opts);
			// 成功施放技能
			this.behavior(opts);
			this.lastCDI = this.coolDownInterval;
			this.trigger('afterFired', opts);
		}
	};

	dino.skill = skill;

})(window);